home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Loadstar 53
/
053.d81
/
roman numeral
(
.txt
)
< prev
next >
Wrap
Commodore BASIC
|
2022-08-26
|
19KB
|
455 lines
150 p1=53280:p2=53281:print"[147]":pokep1,1:pokep2,1:poke53269,255:poke53269,0
170 printchr$(142)" one moment please..."
180 a=646:d=1:dimt$(100),wq(45):goto5530
190 pokev+41,1:pokev+29,4:poke53269,peek(53269)or4:poke53269,0
200 pokev+39,1:pokev+29,1:poke53269,peek(53269)or1:poke53269,0:fort=41to46:pokev+t,2:nextt
220 v1=10:w1=17:u1=33:l1=134:a1=10:c1=1200
225 jj=1
226 goto 270
260 poke49,peek(47):poke50,peek(48)
270 w=0:print"[147]":pokep1,0:pokep2,0:printtab(9)"[158] roman numeral teacher "
280 printtab(13)"[153](c) mcmlxxxviii":ifd=1thengosub4050:d=0
290 ifj<>1thenv1=12:w1=17:u1=50:l1=58:a1=10:c1=1350:gosub5240
300 j=0:v=0:v1=8:print"":printtab(5)"[154]select one letter: (l/r/q/e)[158]"
320 printtab(5)"l[146] learning roman numerals":printtab(5)"r[146] roman numeral examples":kk=0
340 printtab(5)"q[146] roman numerals quiz":printtab(5)"e[146] end[154]":print:print:iffs>0thengosub470
370 v1=10:w1=17:u1=67:l1=12:a1=10:c1=900:gosub5240
380 w1=17:c1=1000:u1=100:l1=117:a1=15
390 getd$:ifd$="r"then850
410 ifd$="l"thenprint""tab(5)" ":goto1090
420 ifd$="q"theng=0:goto3150
430 ifd$="e"thengosub7000
450 goto390
460 :
470 fort=1to250:nextt:m$="quiz tally:":n$="[157] right out of":p$="[157] tries":printtab(2)"";
490 formm=1to13:printmid$(m$,mm,1);:next:printft;:fornn=1to14
500 printmid$(n$,nn,1);:next:printfs;:forps=1to7:printmid$(p$,ps,1);:next:print:mm=0:nn=0:pp=0:return
540 poke53248+29,2:poke53269,peek(53269)or2:printtab(5)"[158] right! ";
560 ifb=1orb=3thenprinta$" ="x:goto580
570 print"[157]"x"= "a$;
580 print"[145][145][145][145][145][145]":poke781,19:sys59903:ct=0:ft=ft+1:fs=fs+1:cj=1:cp=1:gosub5320
600 z=z+1:zz=zz+1:fort=1to1000:nextt:g=0:poke53269,peek(53269)and(253)
610 cc=1:pp=1:rr=0:gosub4650:poke781,22:sys59903:poke214,17:print:poke211,0
630 print"[153]"z"[157] right out of"zz" ";:printint((z/zz)*100)"[157]% ":return
670 print"[147]":print" important point!":c1=1000:w1=17:a1=15:gosub5240
690 print" one more thing before going back to the main menu..."
700 print" if you put a bar over a roman-numeral"
710 print" letter, the value of that letter":print" is multiplied by 1000."
720 printtab(7)"[210]"tab(23)"[210]":print" like: x=10,000...or...m=1,000,000":print" usually only"
750 print" the letters 'v', 'x' and 'm' are used":print" so..."
760 printtab(15)"[198]":printtab(15)"vmdclxvii":print" equals: 5000+1000+500+100+50+10+5+1+1"
780 printtab(17)"6667":print" none of these examples appear in quiz!"
800 printtab(7)"[156] for main menu, press 'm'";:ifk=1thenk=0
810 getm$:ifm$="m"thenj=1:return
820 goto810
850 pokep1,1:pokep2,1:gosub5240:a$="":aa=1:bb=3999
860 gosub3740:print" example":print" roman numeralstandard number"
890 print" "a$tab(22)x:ifv=1thenprinttab(9)"([158]subtraction needed)":v=0
900 poke214,20:print:poke211,1:print"want another example? press 'a'"
910 print" return to main menu?? press 'm'":jj=1:gosub990
930 getf$:iff$=""then930
940 iff$="a"thena$="":goto860
950 iff$="m"thenj=1:goto270
960 goto930
990 forr=54272to54295:poker,0:next:vl=54296:wf=54276:ad=54277:nh=54273:nl=54272
1010 pokevl,15:pokewf,33:pokead,10:pokenh,200:pokenl,243:ifjj=1thenforn=1to500:next:goto1030
1020 forn=1to1500:next
1030 pokenh,0:pokenl,0:pokead,0:ifjj=1thenjj=0:return
1050 getg$:ifg$=chr$(13)thenreturn
1060 goto1050
1090 pokep1,7:pokep2,7:a1=15:print"[147]":gosub5240:print"[147]":print" roman numerals"
1110 print" roman numerals use letters instead of regular numerals.";
1120 print" you should remember that specific letters";
1130 print" are used for":print" specific standard (arabic) numbers."
1140 print"[156] press <return> for roman numeral chart[151]":gosub1050
1180 c1=100:gosub5240
1190 print" roman standard ":ifk=1thenc1=100:gosub5240
1210 printtab(7)"[145]numeral number":printtab(13)"i"tab(19)"="tab(25)"1"
1230 printtab(13)"v"tab(19)"="tab(25)"5":printtab(13)"x"tab(19)"="tab(25)"10":printtab(13)"l"tab(19)"="tab(25)"50"
1260 printtab(13)"c"tab(19)"="tab(25)"100":printtab(13)"d"tab(19)"="tab(25)"500"
1280 printtab(13)"m"tab(19)"="tab(25)"1000":ifv=1thenv=0:print"":goto1330
1290 print" by combining certain letters, you can build the roman";
1300 print" numeral you need.";:print"..by observing the letters you have, ";
1310 print"you can easily change any roman numeral into an everyday";
1320 print" arabic number."
1330 ifk=1ors=1thenprinttab(5)"[158]to return to previous page, 'p'"
1340 printtab(4)"to go to learning menu, press 'l'[144]";
1350 geth$:ifh$=""then1350
1360 ifh$="l"thens=0:v=0:goto1410
1370 ifh$="p"andk=1ors=1thenreturn
1380 goto1350
1410 c1=500:k1=0:gosub5240:pokep1,3:pokep2,3:print"[147]":print"[151] how to"
1440 print" select one: (1/2/3/4)"
1450 print" 1[146] change roman numerals to standard":k=0
1460 print" 2[146] change standard numbers to roman"
1470 print" 3[146] return to roman numeral chart":print" 4[146] return to main menu":d=0
1490 gett$:ift$=""then1490
1500 ift$="1"thenv=1:k$=" #1":gosub6340:goto1550
1510 ift$="2"thenk$=" #2":gosub6340:goto2250
1520 ift$="3"thenv=1:print"[147] roman numerals.":c1=200:gosub5240:goto1190
1530 ift$="4"thenj=1:goto270
1540 goto1490
1550 c1=100:gosub5240:ifk1=1thenk=1
1570 print"[147] how to "k$"[146]";:ifk=1thenprint" "
1580 ifk<>1thenprint" press <return> to continue"
1590 print" when changing from a roman numeral to an ordinary";
1600 print" number, read your roman numeral from right to left (_)":ifk<>1thengosub1050
1620 print" here's an example.":print" change lxxvi to an arabic numeral.":ifk<>1thengosub990
1640 print" read it backwards -- right to left (_)"
1650 print" since i=1, v=5, x=10, x=10, l=50..."
1660 print" (remember your roman numeral chart?)":ifk<>1thengosub990
1680 print" and since the numbers do not get"
1690 print" smaller: 1...5...10...10...50, just":ifk<>1thengosub990
1710 print" add 'em all up -- 1+5+10+10+50 = 76":printtab(15)"lxxvi=76":ifk<>1thengosub990
1730 print"[156] continue lesson? press <return>"
1740 print" go to roman numeral chart? press 'r'"
1750 print" how to"k$"[146] ":ifk<>1thenc1=100:gosub5240
1770 ifk=1thenk=0
1780 getj$:ifj$=chr$(13)then1820
1790 ifj$="r"thenv=1:k=1:print"[147] roman numerals.":gosub1190:goto1550
1800 goto1780
1810 jj=1:gosub990
1820 c1=100:gosub5240:ifk1=1thenk=1
1840 print"[147] how to"k$"[146]";:ifk=1thenprint" "
1850 ifk<>1thenprint" press <return> to continue"
1860 print" sometimes roman numerals get tricky.":ifk<>1thengosub1050
1880 print" look at this example.":print" change xciv to an arabic numeral."
1890 ifk<>1thengosub990
1900 print" as you read 'backwards' (_), notice"
1910 print" some numbers are smaller than ones"
1920 print" to their right: v=5, i=1, c=100, x=10"
1930 print" (forget your roman numeral chart?)":ifk<>1thengosub990
1950 print" if a letter of smaller value is on the"
1960 print" left";:print" of a larger one, you subtract";
1970 print" the smaller one from the greater one.":ifk=1then2000
1990 gosub990
2000 ifk=1thenprint" *";:goto2020
2010 print" [158]*";
2020 print"subtract 'i' from 'v' ... (5-1)=4":ifk=1then2070
2040 poke214,6:print:poke211,10:print"[158][197][197]":gosub990
2060 ifk<>1thenpoke214,6:print:poke211,8:print"[158][197][197] "
2070 ifk=1thenprint" *";:goto2090
2080 print" [158]*";
2090 print"subtract 'x' from 'c' ... (100-10)=90":ifk=1then2130
2110 gosub990:ifk<>1thenpoke214,6:print:poke211,8:print" "
2130 print" now, add these answers up ... 90+4=94":printtab(16)"xciv=94":ifk<>1thengosub990
2160 print"[156] go to roman numeral chart? press 'r'":print" go to main menu? press 'm'"
2180 print" how to"k$"[146] ":ifk<>1thenc1=100:gosub5240
2200 ifk=1thenk=0
2210 geth$:ifh$="r"thenv=1:k=1:print"[147] roman numerals.":gosub1190:goto1820
2230 ifh$="m"thengosub670:goto270
2240 goto2210
2250 c1=100:gosub5240:ifk1=1thenk=1
2270 print"[147] how to"k$"[146]";:ifk=1thenprint" "
2280 ifk<>1thenprint" press <return> to continue"
2290 print" ar